﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace LFSRecord2.View.ViewportStructures
{
    /// <summary>
    /// Interaction logic for TimelineViewCrosshair.xaml
    /// </summary>
    public partial class ViewportObjectCrosshair : Image
    {
        public string ID { get; set; }

        public ViewportObjectCrosshair()
        {
            InitializeComponent();
        }

        private void CrossHairImage_Loaded(object sender, RoutedEventArgs e)
        {
            GeometryGroup tlrGroup = new GeometryGroup();
            tlrGroup.Children.Add(new EllipseGeometry(new Point(0, 0), 3, 3));
            tlrGroup.Children.Add(new LineGeometry(new Point(-6, 0), new Point(-3, 0)));
            tlrGroup.Children.Add(new LineGeometry(new Point(6, 0), new Point(3, 0)));
            tlrGroup.Children.Add(new LineGeometry(new Point(0, 6), new Point(0, 3)));
            tlrGroup.Children.Add(new LineGeometry(new Point(0, -6), new Point(0, -3)));

            GeometryDrawing gd = new GeometryDrawing();
            gd.Geometry = tlrGroup;
            gd.Pen = new Pen(Brushes.LightSkyBlue, 1);
            gd.Freeze();

            Source = new DrawingImage(gd);
            Stretch = Stretch.None;

            Margin = new Thickness(-6, -6, 0, 0);
        }
    }
}
